//
//  RHSystemInfoModel.m
//  RuiHeApp
//
//  Created by Yan Chen on 2025/1/2.
//

#import "RHSystemInfoModel.h"
#import "RHMeOptionTypeModel.h"
@implementation RHSystemInfoModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"optionList" : [RHMeOptionTypeModel class]};
 }

-(void)readInfo:(NSDictionary*)dic
{
    
    if (dic[self.key]) {
        if ([dic[self.key]isKindOfClass:[NSString class]]) {
            self.content = dic[self.key];
        }
        if ([dic[self.key]isKindOfClass:[NSNumber class]]) {
            self.content = [NSDecimalNumber decimalStringWithDouble:[dic[self.key] doubleValue]];
        }
        if ([dic[self.key]isKindOfClass:[NSArray class]]) {
            NSArray *arr = dic[self.key];
            NSMutableArray *mtbArr = [NSMutableArray array];
            [arr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if ([obj isKindOfClass:[NSDictionary class]]) {
                    NSDictionary *dic = obj;
                    if (dic[@"deviceId"]) {
                        [mtbArr addObject:dic[@"deviceId"]];
                    }
                }
            }];
            self.deviceList = mtbArr.copy;
        }
    }
   
}
@end
